package com.twu.biblioteca;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class MenuList {
    private List menus;
    private InputHandler inputHandler;
    private String menuName = "Main Menu";

    public MenuList(){
        menus = new ArrayList();
        inputHandler = new InputHandler();
    }

    public void addItem(String menuName){
        menus.add(menuName);
    }

    public void printMenuListVertically(){
        for(int i=0;i<menus.size();i++){
            System.out.println((i+1)+". "+menus.get(i));
        }
    }

    public boolean execute() throws IOException {
        /*
        switch(index){
            case 1:
                System.out.println("\nBook List");
                bookData.readBookData();
                bookData.printBookData();
                break;

            case 2:
                System.out.print("\nEnter Book ID to reserve: ");
                int id = inputHandler.readOption();
                reserveBookByID(id);
                break;

            case 3:
                System.out.println("Please talk to Librarian. Thank You!");
                break;

            case 4:
                System.out.println("\nThank You!\n");
                 return false;

            default:
                System.out.println("Select a valid option!!");
        } */
        return true;
    }

    /*public void reserveBookByID(int id) {
        String[] messages = {
                             "Thank You! Enjoy the book.",
                             "Sorry! we don't have that book available.",
                             "Sorry! That is invalid book ID!"
                            };
        if(id!=1 && id!=2)
            System.out.println(messages[2]);
        else
            System.out.println(messages[id-1]);
    } */

    public String getMenuName() {
        return menuName;
    }
}
